package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.zr.model.Course;
import com.zr.model.User;
import com.zr.service.CourseServise;
import com.zr.serviceImpl.CourseServiseImpl;

import net.sf.json.JSONArray;

public class SelectCourseControllerWWQ extends HttpServlet {
	 CourseServise css=new CourseServiseImpl();
	
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

		doPost(req, resp);
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("utf8");
		resp.setCharacterEncoding("utf8");		
		JSONArray js=css.getCnameByCid();
		PrintWriter  pw = resp.getWriter();
		pw.write(js.toString());
		
		
	}
	
	
	
	}


